package com.example.demo.user.controller;

import com.example.demo.response.ApiResult;
import com.example.demo.user.rpc.OrderFeignRpc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: miaoguoxin
 * @Date: 2020/3/18 14:05
 * @Description:
 */
@RestController
@RequestMapping("/user")
public class TestController {

    @Value("${server.port}")
    private Integer port;
    @Autowired
    private OrderFeignRpc orderFeignRpc;

    @RequestMapping("/test")
    public ApiResult<Integer> testGateway(){
        return ApiResult.success(port);
    }

    @RequestMapping("/test_feign")
    public ApiResult<String> testFeign(){
        return orderFeignRpc.testRpc();
    }
}
